/*************************************************
Author: byron
Date: 10/16/2012
Description:
Notes:
*************************************************/

#ifndef __CUserRole_h__
#define __CUserRole_h__

#include "commclass.h"
#include "../skill/CSkill.h"

class CPlayerOnlineData;
class PBMsgHead;
namespace CTLib
{
    class CEnpNetHead;
}

class CUserRole
{
public:
    CUserRole()
    {
        Clear();
    }

    void Clear()
    {
        _stAttr.Clear();
        _stNormalSkill.Clear();
        _stAcadSkill.Clear();
        _stMagicSkill.Clear();
    }

    virtual ~CUserRole()
    {
    }

    int InitRoleSkill(CPlayerBaseInfo& stPlayerBase,
            CPlayerDetailInfo& stPlayerDetail);

    int AddExp(CPlayerBaseInfo& stPlayerBase, CPlayerOnlineData& stPlayerOnline,
            CPlayerDetailInfoEx1& stPlayerDetailEx1, int64 i64AddExp);

    int ChgMagicSkill(CPlayerBaseInfo& stPlayerBase,
            CPlayerDetailInfo& stPlayerDetail,
            CPlayerOnlineData& stPlayerOnline, unsigned int uiSkillID);

    CPlayerAttr& GetAttr(){return _stAttr;}
    CSkill& GetNormalSkill(){return _stNormalSkill;}
    CSkill& GetAcadSkill(){return _stAcadSkill;}
    CSkill& GetMagicSkill(){return _stMagicSkill;}

    unsigned int GetMagicSkillID() const {return _stMagicSkill.GetID();}
    unsigned int GetNormalSkillID() const {return _stNormalSkill.GetID();}

private:
    CPlayerAttr         _stAttr;
    CSkill              _stNormalSkill;
    CSkill              _stAcadSkill;
    CSkill              _stMagicSkill;
};

#endif // __CUserRole_h__

